<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models\Env;

use Carbon\Carbon;
use App\Models\Eloquent;

/**
 * Class QtpHost
 *
 * @property int $id
 * @property int $host_env_id
 * @property string $http
 * @property string $remark
 * @property string $created_adminer
 * @property string $updated_adminer
 * @property int $enable
 * @property Carbon|null $created_at
 * @property Carbon|null $updated_at
 *
 * @package App\Models
 */
class Host extends Eloquent
{
	protected $table = 'hosts';

	protected $casts = [
		'host_env_id' => 'int',
		'enable' => 'int'
	];

	protected $fillable = [
		'host_env_id',
		'http',
		'remark',
		'created_adminer',
		'updated_adminer',
		'enable'
	];

    public static $fillables = [
        'host_env_id' => '环境标识ID',
        'http' => '域名',
        'remark' => '域名备注',
        'created_adminer' => '创建人',
        'updated_adminer' => '更新人',
        'enable' => '状态'
    ];

    public function label()
    {
        $this->host_env_name = HostEnv::find($this->host_env_id)->name ?? '';
        return $this;
    }
}
